#include <stdio.h>
#include <rpc/types.h>
#include <rpc/xdr.h>
#include <rpc/rpc.h>


#define PROGNUM 0x20000100
#define VERSNUM 1
#define PROCNUM 1

int x;

int * proc_dist(int *n) { 
  static int res = 0;
  
  res = *n * x;
  x++;
  
  return &res;
}


int main (void) {

	x= 3;

  registerrpc(/* prognum */ PROGNUM,
	     /* versnum */ VERSNUM,
	     /* procnum */ PROCNUM,
	     /* pointer on function */ proc_dist,
	     /* argument decoding */ (xdrproc_t)xdr_int,
	     /* function result encoding */ (xdrproc_t)xdr_int);

  svc_run(); /* server ready for clients */
  
  

  return 0;
}


